package org.wsff.tools.api.gateway.demo.filter;

import org.wsff.tools.api.gateway.core.AbstractProxyFilter;
import org.wsff.tools.api.gateway.core.GatewayContext;
import org.wsff.tools.api.gateway.core.Proxy;
import org.wsff.tools.api.gateway.demo.Apis;
import org.wsff.tools.api.gateway.demo.model.TestRequest;
import org.wsff.tools.api.gateway.demo.model.TestResponse;

/**
 * ExampleTestPostFilter
 * @author ryan
 * @version Id: ExampleTestPostFilter.java, v 0.1 2022-04-03 16:48 ryan Exp $$
 */
@Proxy(id = Apis.EXAMPLE_TEST)
public class ExampleTestPostFilter extends AbstractProxyFilter<TestRequest, TestResponse> {

    /**
     * 执行过滤业务逻辑
     *
     * @param context the context
     */
    @Override
    protected void doAccept(GatewayContext<TestRequest, TestResponse> context) {
        System.out.println("do filter post");
    }

    /**
     * 过滤器类型
     * <p>
     * Sub-class should provides the filter type
     *
     * @return the filter type
     */
    @Override
    public String filterType() {
        return FilterType.POST.name();
    }
}
